package com.example.retrofitinterface;

import com.example.bean.DataBean;
import com.example.bean.Result;
import com.example.okhttp.RHandler;
import com.example.okhttp.RHandler2;
import com.example.okhttp.RHandler3;
import com.okhttp.annotations.ApiGenerateService;
import com.okhttp.annotations.ApiResponseHandler;
import com.okhttp.cache.CacheControl;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Headers;
import retrofit2.http.POST;

@ApiGenerateService(value = Callback.class)
public interface Net {
  
  @Headers(CacheControl.CACHE_HEADER)
  @FormUrlEncoded
  @POST("city")
  public Call<DataBean> getIndexPost(@Field("postTest") String test);
  
  
  @ApiResponseHandler(
    handler = RHandler.class
    ,genericity =DataBean.class
  )
  @FormUrlEncoded
  @POST("city")
  public Call<Result<DataBean>> getIndexPost2(@Field("postTest") String test);
//
  @ApiResponseHandler(
    handler = RHandler2.class
    /*,genericity =DataBean.class*/
  )
  @FormUrlEncoded
  @POST("city")
  public Call<Result<DataBean>> getIndexPost3(@Field("postTest") String test);
//
  @ApiResponseHandler(
   // handler = RHandler3.class,
    genericity =DataBean.class
  )
  @FormUrlEncoded
  @POST("city")
  public Call<Result<DataBean>> getIndexPost4(@Field("postTest") String test);
  
  
}
